<!DOCTYPE html>
<html lang="en" xmlns:th="www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h3>templates目录下的文件</h3>

<table width="80%" border="1px">
    <tr>
        <td>ID</td>
        <td>名称</td>
        <td>密码</td>
        <td>昵称</td>
        <td>创建时间</td>
        <td>操作</td>
    </tr>

    <tr th:each="account: ${list}">
        <td th:text="${account.id}">ID</td>
        <td th:text="${account.userName}">名称</td>
        <td th:text="${account.password}">密码</td>
        <td th:text="${account.nickName}">昵称</td>
        <td th:text="${#dates.format(account.createTime, 'yyyy-MM-dd HH:mm:ss')}">创建时间</td>
        <td>

            <!-- 使用thymeleaf的方式传值到函数中 -->
            <input type="button" value="修改" th:onclick="edit([[${account.id}]])" />

            <!-- 使用thymeleaf的方式进行拼接操作 -->
            <a th:href="@{|/account/del/${account.id}|}" >删除</a>
        </td>
    </tr>
</table>
<script>
    function edit(id){
        console.log("要修改的账号id:"+id) ;
    }


</script>

</body>
</html>
